//
//  CORSDataCenter.m
//  iCourse
//
//  Created by Huo Ju on 12-10-19.
//  Copyright (c) 2012年 1011. All rights reserved.
//

#import "CORSDataCenter.h"

// singleton

@interface  CORSDataCenter()

+ (CORSDataCenter*) initialiaze;

@end

@implementation CORSDataCenter
@synthesize context = context_;
static CORSDataCenter * instance_ = nil;

+ (CORSDataCenter*) dataCenter
{
    if (!instance_) {
        instance_ = [CORSDataCenter initialiaze];
    }
    
    return instance_;
}

+ (CORSDataCenter*) initialiaze
{
    return [[[CORSDataCenter alloc] init] autorelease];
}

+ (CORSDataCenter*) initialiaze: (NSManagedObjectContext *) context
{
    if (!instance_) {
        instance_ = [CORSDataCenter initialiaze];
    }
    instance_.context = context;
    return instance_;
}

@end
